import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium';
import bable from 'vite-plugin-babel';
import legacy from "@vitejs/plugin-legacy";
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  build: {
    rollupOptions: {
      output: {
        crossorigin: false,
      },
    },
  },
  plugins: [vue(), cesium(), bable(
    {
      bableConfig: {
        plugin: [['@babel/plugin-proposal-decorators', , { "legacy": true }], '@babel/plugin-transform-private-methods', '@babel/plugin-transform-class-properties']
      }
    }
  ), legacy()],
  server: {
    port: 8881,
    host: '0.0.0.0'
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
})
